<template>
  <div class="home">
    <h2>Home</h2>
  </div>
</template>

<script>
  export default {
    name: 'home',
  }
</script>
<script setup>
  import { onUnmounted, onActivated, onDeactivated } from 'vue'
  onUnmounted(() => {
    console.log('home unmounted')
  })

  // 对于保持keep-alive组件, 监听有没有进行切换
  // keep-alive组件进入活跃状态
  onActivated(() => {
    console.log('home activated')
  })

  onDeactivated(() => {
    console.log('home deactivated')
  })
</script>

<style lang="scss" scoped></style>
